package com.micookie.v2ex.utils;

/**
 * Created by Administrator on 2016/11/1.
 */

public class StringUtils {

    public static String subString(String s) {
        String sss = "";
        sss = s.substring(1, s.length() - 1);
        return sss;
    }


    /**
     * 剔除字符串中的非数字字符
     * 如果字符串为空返回0
     *
     * @param str
     * @return 只有数字的字符串
     */
    public static String RemoveNotNum(String str) {
        if (str != null) {
            String result = str.replaceAll("[^0-9]", "");
            if (!result.isEmpty()) {
                return result;
            }
        }
        return "0";
    }



}
